import torch
import torchvision
from torch import nn
from torch.utils.data import DataLoader

dataset = torchvision.datasets.CIFAR10("./dataset_2",train=False,transform=torchvision.transforms.ToTensor(),download=True)
data_loader = DataLoader(dataset,64)

class MyNN(nn.Module):
    def __init__(self):
        super(MyNN, self).__init__()
        self.linear = nn.Linear(196608,10)

    def forward(self,input):
        output = self.linear(input)
        return output

my_nn =MyNN()

for data in data_loader:
    imgs,lables = data
    print(imgs.shape)
    # input = torch.reshape(imgs,(1,1,1,-1))
    input = torch.flatten(imgs)
    print(input.shape)
    output = my_nn(input)
    print(output.shape)
